<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>添加成交记录信息</title>
    <link th:replace="common/header"/>
    <script type="text/javascript" th:src="@{/js/androidwheel/androidwheel.js}"></script>
    <script type="text/javascript" th:src="@{/js/My97DatePicker/WdatePicker.js}"></script>
</head>
<body class="no-skin">
<div th:replace="common/top"/>
<div class="main-container ace-save-state" id="main-container">
    <div th:replace="common/menu"/>
    <div class="main-content">
        <div class="main-content-inner">
            <div th:replace="common/title"/>
            <div class="page-content">
                <div th:replace="common/skin"/>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal" action="add.do" name="form" th:action="@{/dealRecordInfo/add}"
                              th:method="post" th:object="${dealRecordInfo}">
                            <h3 class="header smaller lighter blue"><i class="fa fa-plus" aria-hidden="true"></i>添加成交记录信息
                            </h3>
                            <div class="row-fluid">
                                <!--PAGE CONTENT BEGINS HERE-->
                                <div class="span6">
                                    <div class="control-group">
                                        <label class="control-label" for="houseId">房屋名称:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <select th:field="*{houseId}" id="houseId" name="houseId"
                                                    class="input_fix9" th:value="*{houseId}">
                                                <option value="">--请选择--</option>
                                                <option th:each="house : ${houseInfoList}"
                                                        th:value="${house.id}"
                                                        th:text="${house.houseName}"></option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="span6">
                                    <div class="control-group">
                                        <label class="control-label" for="buyer">购买人:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <input name="buyer" id="buyer" class="input_fix" placeholder="购买人"
                                                   th:value="*{buyer}" maxlength="50"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('houseId')}"
                                                                  th:errors="*{houseId}">
                                        Name Error</span>&nbsp;</span>
                                </div>
                                <div class="span6">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('buyer')}"
                                                                  th:errors="*{buyer}">Name
                                        Error</span>&nbsp;</span>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <!--PAGE CONTENT BEGINS HERE-->
                                <div class="span6">
                                    <div class="control-group">
                                        <label class="control-label" for="phone">联系电话:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <input name="phone" id="phone" class="input_fix" placeholder="联系电话"
                                                   th:value="*{phone}"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="span6">
                                    <div class="control-group">
                                        <label class="control-label" for="idCard">身份证:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <input name="idCard" id="idCard" class="input_fix" placeholder="身份证"
                                                   th:value="*{idCard}"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('phone')}"
                                                                  th:errors="*{phone}">Name Error</span>&nbsp;</span>
                                </div>
                                <div class="span6">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('idCard')}"
                                                                  th:errors="*{idCard}">Name Error</span>&nbsp;</span>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <div class="control-group">
                                        <label class="control-label" for="address">详细地址:<span style="color:red">*</span></label>
                                        <div class="controls">
                                            <input name="address" id="address" class="input_fix" placeholder="详细地址"
                                                   th:value="*{address}"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="span6">
                                    <div class="control-group">
                                        <label class="control-label" for="price">成交价格:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <input name="price" id="price" class="input_fix" placeholder="成交价格"
                                                   th:value="*{price}"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('address')}"
                                                                  th:errors="*{address}">Name Error</span>&nbsp;</span>
                                </div>
                                <div class="span6">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('price')}"
                                                                  th:errors="*{price}">Name Error</span>&nbsp;</span>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <div class="control-group">
                                        <label class="control-label" for="dealTime">成交时间:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <input name="dealTime" id="dealTime" class="input_fix7" placeholder="成交时间"
                                                   th:value="*{dealTime} == null ? '' : *{#dates.format(dealTime, 'yyyy-MM-dd HH:mm:ss')}"/>
                                            <img onclick="WdatePicker({el:'dealTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                                 style="width:16px;height:22px" align="middle"
                                                 th:src="@{/js/My97DatePicker/skin/datePicker.gif}"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="span6">
                                    <div class="control-group">
                                        <label class="control-label" for="dealType">成交类型:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <select th:field="*{dealType}" id="dealType" name="dealType"
                                                    class="input_fix9" th:value="*{dealType}">
                                                <option value="">--请选择--</option>
                                                <option th:each="dealType : ${T(xyz.ibenben.zhongdian.system.entity.enums.DealRecordTypeEnum).values()}"
                                                        th:value="${dealType}"
                                                        th:text="${dealType.text}"></option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('dealTime')}"
                                                                  th:errors="*{dealTime}">Name Error</span></span>
                                </div>
                                <div class="span6">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('dealType')}"
                                                                  th:errors="*{dealType}">Name Error</span>&nbsp;</span>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <!--PAGE CONTENT BEGINS HERE-->
                                <div class="span12">
                                    <div class="control-group">
                                        <label class="control-label" for="province">所在省-所在市-所在区/县/镇:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <select th:field="*{province}" id="province" name="province"
                                                    class="input_fix3" th:value="*{province}"
                                                    th:onchange="'provinceChange(this.value, null, \'--请选择--\')'">
                                                <option value="">--请选择--</option>
                                                <option th:each="province : ${provinceList}"
                                                        th:value="${province.provinceCode}"
                                                        th:text="${province.provinceName}">山东
                                                </option>
                                            </select>-
                                            <select th:field="*{city}" id="city" name="city" class="input_fix3"
                                                    th:value="*{city}"
                                                    th:onchange="'cityChange(this.value, null, \'--请选择--\')'">
                                                <option value="">--请选择--</option>
                                                <option th:each="city : ${cityList}"
                                                        th:value="${city.cityCode}" th:text="${city.cityName}">青岛
                                                </option>
                                            </select>-
                                            <select th:field="*{region}" id="region" name="region" class="input_fix3"
                                                    th:value="*{region}">
                                                <option value="">--请选择--</option>
                                                <option th:each="region : ${regionList}"
                                                        th:value="${region.regionCode}" th:text="${region.regionName}">
                                                    市北
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span12">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('province')}"
                                                                  th:errors="*{province}">Name Error</span>
                                        <span th:if="${#fields.hasErrors('city')}" th:errors="*{city}">Name Error</span>
                                        <span th:if="${#fields.hasErrors('region')}"
                                              th:errors="*{region}">Name Error</span>&nbsp;</span>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span12">
                                    <div class="control-group">
                                        <label class="control-label" for="discountId">折扣:<span
                                                style="color:red">*</span></label>
                                        <div class="controls">
                                            <select th:field="*{discountId}" id="discountId" name="discountId"
                                                    class="input_fix9" th:value="*{discountId}">
                                                <option value="">--请选择--</option>
                                                <option th:each="discount : ${discountInfoList}"
                                                        th:value="${discount.id}"
                                                        th:text="${discount.discountPercent}"></option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span12">
                                    <span style="color:red"><span th:if="${#fields.hasErrors('discountId')}"
                                                                  th:errors="*{discountId}">Name Error</span>&nbsp;</span>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="text-center span12">
                                    <button shiro:hasPermission="/dealRecordInfo/add" class="btn btn-primary"
                                            type="submit"><i class="fa fa-floppy-o" aria-hidden="true"></i>提交
                                    </button>
                                    <button shiro:hasPermission="/dealRecordInfo/add" class="btn btn-danger"
                                            type="reset">
                                        <i class="fa fa-times" aria-hidden="true"></i>取消
                                    </button>
                                    <a shiro:hasPermission="/dealRecordInfo/getAll" class="btn" href="getAll"
                                       th:href="@{/dealRecordInfo/getAll}"><i class="fa fa-reply"
                                                                              aria-hidden="true"></i>返回</a>
                                </div>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <div th:replace="common/footer"/>
</div><!-- /.main-container -->
<div th:replace="common/buttom"/>

<script type="text/javascript">
    $("form").submit(function () {
        $(":submit", this).attr("disabled", "disabled");
    });
</script>
</body>
</html>
